package com.deng.codetemplate.controller;

import com.deng.codetemplate.config.Result;
import com.deng.codetemplate.model.entity.User;
import com.deng.codetemplate.service.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 邓天天
 * @date 2021/4/27 20:56
 */
@RestController("/user")
public class UserController {

    @Autowired
    private UserServiceImpl userService;

    @GetMapping("/list")
    public Result<List<User>> listAllUser() {
        return Result.success(userService.list());
    }
}
